#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project : chat_model 
# @File    : schema.py
# @IDE     : PyCharm 
# @Author  :ZH
# @Time    : 2025/1/4 13:52
from datetime import datetime

from pydantic import BaseModel
from typing import Optional, List


class DrawModelListResponseBase(BaseModel):
    id: Optional[int]
    update_date: Optional[datetime]
    model_name_zh: Optional[str]
    model_name: Optional[str]
    firm: Optional[int]
    description: Optional[str]


class DrawModelListResponse(BaseModel):
    code: int
    message: str
    count: int
    data: Optional[List[DrawModelListResponseBase]]


class DrawModelListQuery(BaseModel):
    page: Optional[int] = 1
    limit: Optional[int] = 10
    name: Optional[str] = None


class DrawSessionCreate(BaseModel):
    session_name: Optional[str] = '新建画板'
    model_id: Optional[int]
    description: Optional[str]


class DrawSessionUpdate(BaseModel):
    session_id: int
    session_name: Optional[str] = None
    model_id: Optional[int] = None


class DrawSessionListQuery(BaseModel):
    page: Optional[int] = 1
    limit: Optional[int] = 10
    name: Optional[str] = None


class DrawSessionResponseBase(BaseModel):
    id: Optional[int]
    session_name: Optional[str]
    model_id: Optional[int]
    description: Optional[str]
    update_date: Optional[datetime]


class DrawSessionResponse(BaseModel):
    code: int
    message: str
    data: Optional[DrawSessionResponseBase]


class DrawDialogueListQuery(BaseModel):
    session_id: int
    page: Optional[int] = 1
    limit: Optional[int] = 10


class DrawDialogueListResponseBase(BaseModel):
    id: Optional[int]
    query: Optional[str]
    answer: Optional[str]
    model_name: Optional[str]


class DrawDialogueListResponse(BaseModel):
    code: int
    message: str
    count: Optional[int]
    data: Optional[List[DrawDialogueListResponseBase]]


class DrawQuery(BaseModel):
    session_id: Optional[int]
    query: str


class DrawResponseBase(BaseModel):
    session_id: Optional[int]
    answer: Optional[str]


class DrawResponse(BaseModel):
    code: int
    message: str
    data: Optional[DrawResponseBase]


class DefaultDrawResponse(BaseModel):
    code: int
    message: str
